home *** CD-ROM | disk | FTP | other *** search
/ PC Open 100 / PC Open 100 CD 1.bin / CD1 / INTERNET / WEBDESIGN / Tsw WebCoder / tswwebcoder5en.exe / {app} / scripts / scriptcode / TSW PHP Scripts / phpsinglelinecomment.tss < prev   
Encoding:
Text File  |  2003-09-22  |  634 b   |  34 lines

  1. {
  2. [Scriptsettings]
  3. Scriptname=PHP singleline comment
  4. ExecuteOnStartup=0
  5. ExecuteOnlyOnce=0
  6. }
  7. program PHPSingleLineComment;
  8.  
  9. function CommentIt(s: string) : string;
  10. var
  11.  TempList: TStringList;
  12.  Temp: string;
  13.  i: integer;
  14. begin
  15.  Temp := '';
  16.  TempList := TStringList.Create;
  17.  TempList.Text := s;
  18.  for i := 0 to TempList.Count - 1 do
  19.   begin
  20.    if TempList.Strings[i] <> '' then
  21.     Temp := Temp + '//'+TempList.Strings[i];
  22.    Temp := Temp  + #13#10;
  23.   end;  
  24.  TempList.Free;
  25.  Result := Temp;
  26. end;
  27.  
  28. var
  29.  Code: string;
  30. begin
  31.  If Editor.SelText <> '' then
  32.   Editor.SelText := CommentIt(Editor.SelText);
  33. end;
  34.